﻿@model IEnumerable<ArivisAccounts.Models.EditUserModel>

@{
    ViewBag.Title = "Users";
}

@section Navigation{
    Users: @Model.Count()
}
<table class="data-table">
    <tr>
        <th style="width:40%">
            @Html.DisplayNameFor(model => model.User)
        </th>
        <th style="width:40%">
            @Html.DisplayNameFor(model => model.RolesForUser)
        </th>
        @if (User.IsInRole("Admin"))
        {
        <th>Actions</th>
        }
    </tr>

@foreach (var item in Model) {
    <tr class="data-row">
        <td>
            @Html.DisplayFor(modelItem => item.User)
        </td>
        <td>
            @Html.Encode(string.Join(", ", item.RolesForUser))
        </td>
        @if (User.IsInRole("Admin"))
        {
        <td>
            @Html.ActionLink("Edit", "Edit", new { user = item.User }) |
            @Html.ActionLink("Reset Password", "ResetPassword", new { user = item.User })
        </td>
        }
    </tr>
}

</table>
<p>
    @Html.ActionLink("Create New Account", "Create")
</p>

